package com.marvels.financial.utils;

import java.util.Map;
import java.util.TreeMap;

import com.marvels.common.utils.MarvelsLogUtil;

public class StringHelperUtil {
	
	 /**
     * 返回参数处理
     * @return
     * @throws Exception 
     */
    public static Map<String,String> getParm(String Rstr){
    	Map<String,String> DateArry = new TreeMap<String,String>();
    	try {
        	String[] ListObj=Rstr.split("&");    	
        	for(String Temp:ListObj){    		
        		if(Temp.matches("(.+?)=(.+?)")){
        			String[] TempListObj=Temp.split("=");    			
        			DateArry.put(TempListObj[0], TempListObj[1]);   			
        		}else if(Temp.matches("(.+?)=")){
        			String[] TempListObj=Temp.split("=");
        			DateArry.put(TempListObj[0],"");
        		}else{
        			MarvelsLogUtil.getInstance().info(">>>>>>>>字符串转treeMap无法分解！");
        		}
        	}    	
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error(">>>>>>>>字符串转treeMap分解异常！",e);
		}
    	return DateArry;
    }
}
